import paho.mqtt.client as mqtt                                                  

def on_connect(client, userdata, flags, rc):                                     
    print("Connected with result code "+str(rc))                                 
    client.subscribe("topic/3023")                                               

def on_message(client, userdata, msg):                                           
    print("on_message "+msg.topic+" "+str(msg.payload))                          

client = mqtt.Client(client_id="", clean_session=True, userdata=None, protocol=mqtt.MQTTv31, transport="tcp")
client.username_pw_set("admin", "password")                                      
client.on_connect = on_connect                                                   
client.on_message = on_message                                                   

client.connect("10.97.104.189", 61613, 60)                                      
client.loop_forever()